package com.example.demo.controller;

import com.example.demo.service.IUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class UserController {
//    @Resource(name = "manUserService")
    @Resource
//    @Autowired(required = false)
//    @Autowired
    private IUserService userService;

    @GetMapping("/name")
    public String getName() {
        String name = userService.getName();
        System.out.println(name);
        return name;
    }
}
